#include <stdio.h>
#include <string.h>

int set_rate(unsigned int up_rate, unsigned int down_rate) 
{
	printf("Receive server set rate information:\n");
	if (up_rate > 0) {
		printf("\tUpload rate is set to: %d\n", up_rate);
	}
	if (down_rate > 0) 
	{
		printf("\tDownload rate is set to: %d\n", down_rate);
	}
	return 1;
}


int get_traffic(unsigned int *instant_up_rate, unsigned int *instant_down_rate, unsigned int *total_up_traffic, unsigned int *total_down_traffic) 
{
	static unsigned int test = 100;
	*total_up_traffic = 1000 + test;
	*total_down_traffic = 2000 + test;
	//*total_up_traffic = 97656250;
	//*total_down_traffic = 97656251;
	test += 100;
	*instant_up_rate = 20;
	*instant_down_rate = 50;
	return 1;
}

int show_message(char *message, unsigned int message_length) 
{
	printf("Receive message from server: %s\n", message);
	return 1;
}

int client_exit() 
{
	printf("Keeping alive terminated, client exit.");
	return 1;
}

int set_user_type(int type) {
	printf("Set user type: %d", type);
	return 1;
}

int set_user_mac(char *mac){
	const char my_mac[] = "00-11-22-33-44-55";
	memcpy(mac, my_mac, strlen(my_mac));
	return 1;
}

int set_client_version(int version) {
	version = 316;
	return 1;
}

void enable_mini()
{
	printf("enable mini gateway\n");
}

void disable_mini()
{
	printf("disable mini gateway\n");
}